# -*- encoding=utf8 -*-
__author__ = "Simon"

from airtest.core.api import *
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
using("../main.air")
import main

def explore2():
    #获取旋转后的分辨率
    x,y=device().get_current_resolution()
    sleep(1)
    main.judge_sheet(x,y)
    sleep(2)
    main.risk_entry(x,y)
    sleep(2)
    touch([0.75*x,0.25*y])
    sleep(2)
    #经验关
    touch([0.6*x,0.4*y])
    sleep(2)
    if exists(Template(r"tpl1596792980764.png", threshold=0.8999999999999999, rgb=False, record_pos=(0.207, 0.178), resolution=(1280, 720))):
        touch([0.75*x,0.28*y])
        sleep(2)
        main.add_tick(x,y,2)
        sleep(2)
        main.use_tick(x,y)
        sleep(2)
        main.cilck_blue_ok()
        touch(Template(r"tpl1596793513963.png", record_pos=(0.001, 0.216), resolution=(1280, 720)))
        sleep(2)
    else:
        print("经验关刷完了哦")
        touch([0.03*x,0.06*y])
        sleep(2)
    #mana关
    touch([0.85*x,0.42*y])
    sleep(1)
    if exists(Template(r"tpl1596792980764.png", threshold=0.8999999999999999, record_pos=(0.207, 0.178), resolution=(1280, 720))):
        touch([0.75*x,0.28*y])
        sleep(2)
        main.add_tick(x,y,2)
        sleep(2)
        main.use_tick(x,y)
        sleep(2)
        main.cilck_blue_ok()
        sleep(2)
        touch(Template(r"tpl1596793513963.png", record_pos=(0.001, 0.216), resolution=(1280, 720)))
        sleep(2)
        main.sheet_entry(x,y)
        sleep(2)
    else:
        print("玛娜关刷完了哦")
    #     touch([0.03*x,0.06*y])
        main.sheet_entry(x,y)
        sleep(1)